.overlay displays a secondary view in front of the Parent View. It won't affect Parent View in any way.
Which mean that it does opposite from the .background which displays a secondary view behind the Parent View.
Syntax
.overlay(Image("BlueBubble").resizable())
Example
struct ContentView: View {
var body: some View {
Text("Some text").padding(100).border(Color.red, width: 3)
.overlay(Image("BlueBubble").resizable())
}
}
Output